package kim.artemis.rpc.demo.provider.configuration;

import kim.artemis.rpc.core.protocol.server.ArtemisRpcServerFactory;
import lombok.extern.slf4j.Slf4j;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Slf4j
@Configuration
public class ArtemisConfiguration {

    private String address = "192.168.0.102:2181";

    @Bean
    public ArtemisRpcServerFactory artemisRpcServerFactory () {
        ArtemisRpcServerFactory artemisRpcServerFactory = new ArtemisRpcServerFactory();
        artemisRpcServerFactory.setRegistry("Zookeeper");
        artemisRpcServerFactory.setAddress(address);
        artemisRpcServerFactory.setPort(19527);
        log.info(">>>>>>> artemis rpc, server config init finish.");
        return artemisRpcServerFactory;
    }

}
